import { createRouter, createWebHistory } from 'vue-router'

const router = createRouter({
  history: createWebHistory(),
  routes: [
    {
      path: '/',
      name: 'home',
      
      
      component: () => import('@/views/Home.vue'),
      
      children: [
        {
          path: '',
          name: 'homeIndex',
          component: () => import('@/views/HomeIndex.vue')
        },
        {
          path: ':code',
          name: 'homea',
          component: () => import('@/views/HomeIndex.vue')
        },
        {
          path: 'manage',
          name: 'manage',
          component: () => import('@/views/manage/ManageIndex.vue'),
          children: [
            {
              path: 'article',
              name: 'article',
              meta: {
                title: '文章管理'
              },
              component: () => import('@/views/manage/article/index.vue')
            },
            {
              path: 'article-tag',
              name: 'articleTag',
              meta: {
                title: '文章标签管理'
              },
              component: () => import('@/views/manage/articleTag/index.vue')
            },
            {
              path: 'article-type',
              name: 'articleType',
              meta: {
                title: '文章类型管理'
              },
              component: () => import('@/views/manage/articleType/index.vue')
            }
          ]
        }
      ]
    },

    {
      path: '/editor',
      name: 'editor',
      component: () => import('@/views/editor/drafts.vue')
    }
  ]
})

export default router
